# coding:utf-8
# @Time : 2021/5/13 15:55 
# @Author : minuy
# @File : order.py

from sqlalchemy import Column, Integer, Text, String, Enum
from app.models import BaseModel


class Order(BaseModel):
    """
    状态码sta：下单方
    状态码sta2：服务方
    0：已下单
    1：已接受
    2：已完成
    3：已取消
    4：已删除
    """
    __tablename__ = 't_order'
    __table_args__ = {'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'}

    user_id = Column(Integer, nullable=False)  # 下单
    server_id = Column(Integer, nullable=False)  # 被下单
    # user_id = Column(Integer, ForeignKey('user.id'), nullable=False)

    okami_id = Column(Integer, nullable=False)  # 发布id
    total = Column(Integer, nullable=False)  # 总价
    number = Column(Integer, nullable=False)  # 数量
    sta = Column(Integer, nullable=False, default=0)  # 状态，3步
    sta2 = Column(Integer, nullable=False, default=0)  # 状态，3步
    remarks = Column(String(200), nullable=False)  # 备注
